package com.founder.cebxkit;

//import android.util.Log;

public class CxRect {
	public float left;
	public float top;
	public float right;
	public float bottom;

	public CxRect() {
		left = 0;
		top = 0;
		right = 0;
		bottom = 0;
	}

	public void SetRectValue(float l, float t, float r, float b) {
		left = l;
		top = t;
		right = r;
		bottom = b;
	}

	/**
	 * exchange left and right if left > right,
	 * exchange top and bottom if top > bottom.
	 */
	public void normalize() {
		if (left > right) {
			float t = left;
			left = right;
			right = t;
		}
		if (top > bottom) {
			float t = top;
			top = bottom;
			bottom = t;
		}
	}

	@Override
	public String toString() {
		return "Rect : Left" + Integer.toString((int)left) +
		",Top " + Integer.toString((int)top) +
		",right" + Integer.toString((int)right) +
		",bottom" + Integer.toString((int)bottom);
	}
}
